﻿using System;
using System.Collections.Generic;

namespace DesignPattern.Adapter
{
    /// <summary>
    /// 邦富用户
    /// </summary>
    public class BarfooUser : User, IBarfooUser
    {
        
        /// <summary>
        /// 获取用户所有组
        /// </summary>
        /// <param name="id"></param>
        public void GetUserAllGroup(int id)
        {
            base.GetUserGroup(id);
            Console.WriteLine("BarfooUser:GetUserAllGroup");
        }
    }


    public class BarfooUser1 : IBarfooUser
    {
        IUser user { get; set; }

        public BarfooUser1(IUser user)
        {
            this.user = user;
        }
        /// <summary>
        /// 获取用户所有组
        /// </summary>
        /// <param name="id"></param>
        public void GetUserAllGroup(int id)
        {
            this.user.GetUserById(1);
            Console.WriteLine("BarfooUser1:GetUserAllGroup");
        }
    }
}
